<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Val</title>
    <script src="../../js/jquery.1.8.3.min.js"></script>
    <script>
        $(function () {
            $("#btn1").click(function () {
               var text = $(":text");
               console.log(text.val());
            });

            $("#btn2").click(function () {
                var text = $(":text");
                text.val("没有钱！");
            })
        })
    </script>
</head>
<body>
    <input type="text" value="钱多多">
    <button id="btn1">获取val</button>
    <button id="btn2">设置val</button>
</body>
</html>